package com.jdd.modules.area.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jdd.modules.area.entity.ParkAreaInfo;
import com.jdd.modules.area.mapper.ParkAreaInfoMapper;
import com.jdd.modules.area.service.IParkAreaInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 停车场区域信息表
 * @Author: jdd
 * @Date: 2021-07-15
 * @Version: V1.0
 */
@Service
public class ParkAreaInfoServiceImpl extends ServiceImpl<ParkAreaInfoMapper, ParkAreaInfo> implements IParkAreaInfoService {

    @Resource
    ParkAreaInfoMapper parkAreaInfoMapper;


    /**
     * 清空表数据
     *
     * @return true 清空成功
     */
    @Override
    public boolean removeAllInfo() {
        try {
            parkAreaInfoMapper.removeAllInfo();
        } catch (Exception e) {
            return false;
        }
        return true;
    }

    /**
     * 根据权限组ID查询权限组下所有区域信息
     *
     * @param permissionId
     * @return 区域信息
     */
    @Override
    public List<ParkAreaInfo> getByPermissionIdAndAreaInfoList(String permissionId) {
        return parkAreaInfoMapper.selectByPermissionIdAndAreaInfoList(permissionId);
    }
}
